<template>
  <div class="flow-timeline">
    <div class="flow-timeline-top">
      <i class="el-icon-time"></i>
      <div class="flow-timeline-top-link"></div>
    </div>
    <div class="flow-timeline-item" v-for="(list,index) in timelineData">
      <div class="flow-timeline-item_time">
        <div>2018-03-23{{index}}</div>
        <span>10:31:25</span>
      </div>
      <div class="flow-timeline-item_line">
        <div class="flow-timeline-item_line-border">
          <div class="flow-timeline-item_line-ball"></div>
        </div>
        <div class="flow-timeline-item_line-link" v-show="index+1 !== timelineData.length"></div>
      </div>
      <div class="flow-timeline-item_box">
        <div class="flow-timeline-item_box_content"></div>
      </div>
    </div>
  </div>
</template>

<style type="text/scss" lang="scss">

  .flow-timeline-top {
    height: 100px;
    margin-left: 160px;
    color: #2892e9;
    font-size: 35px;
    &-link {
      margin-left: 14px;
      height: 50%;
      width: 3px;
      background: #2892e9;
    }
  }

  .flow-timeline-item {
    width: 100%;
    height: 230px;
    display: flex;
    &_time {
      width: 120px;
      text-align: right;
      color: #fff;
      padding: 15px;
      span {
        color: #ccc;
      }
    }
    &_line {
      width: 30px;
      padding: 15px;
      &-border {
        position: relative;
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 1px solid #2892e9;
        border-radius: 50%;
      }
      &-ball {
        position: absolute;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #2892e9;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
      &-link {
        margin-left: 9px;
        height: calc(100% - 12px);
        width: 3px;
        background: #2892e9;
      }
    }
    &_box {
      float: right;
      height: 138px;
      flex: 1;
      background: #11325a;
      border: 2px solid #2564ac;
      position: relative;
      border-radius: 5px;
      &:after, &:before {
        border: solid transparent;
        content: ' ';
        height: 0;
        position: absolute;
        width: 0;
      }
      &:after {
        border-width: 10px;
        border-right-color: #11325a;
        left: -20px;
        top: 14px;
      }

      &:before {
        border-width: 14px;
        border-right-color: #2564ac;
        left: -28px;
        top: 10px;
      }
      &_content {
        width: 100%;
        height: 100%;
      }
    }
  }
</style>

<script>
  export default {
    components: {},
    data() {
      return {
        timelineData: [2, 3, 4]
      }
    },
    methods: {},
    created() {
    }
  }
</script>
